﻿using fastdb.ComputeTreeNode;
using fastdb.Lexer;

namespace fastdb.Parser;

public class SqlParser
{
    public List<string> Errors = new();

    public SqlNode Parser(List<TokenNode> tokens)
    {
        var rootNode = new SqlNode();

        //case 1: select 1
        var cursor = new ParserCursor(tokens);
        Errors.Clear();

        while (true)
        {
            var currentToken = cursor.MoveNext();
            if (currentToken == null) break;

            if (currentToken.TokenType == TokenTypeEnum.SELECT)
            {
            }
            else
            {
                Errors.Add("select以外的操作暂不支持");
            }
        }


        return rootNode;
    }
}